import {
	request_post
} from './request.js'

import {
	getData
} from '@/tools/tools.js'

// 用户登录 
export const user_Login = (from) => {
	let username = from.username
	let password = from.password
	return request_post('/userlogin', {
		username: username,
		password: password
	})
}

// 微信获取openid 
export const getUserOpenid = (from) => {
	return request_post('/get_openid_controller', {
		code: from
	})
}

// 绑定微信
export const getChangeUserOpenId = (from) => {
	return request_post('/bindwechat', {
		user_id: getData().id,
		open_id: from
	})
}

// 微信登录
export const weChatOpenidLogin = (from) => {
	return request_post('/userwechatlogin', {
		user_id: getData().id,
		open_id: from
	})
}